<template>
  <div>vue3过滤器移除{{ $filters.format("帝血弑天") }}</div>
  <div>全局变量使用{{ $env }}</div>
  <div><button @click="showLoading">显示</button></div>
  <div>
    <div>我是父组件</div>
    <A title="父组件" value="123"></A>
  </div>
  <div>
    <img id="img" src="./234.png" alt="" />
  </div>
</template>

<script lang="ts" setup>
import A from "./hookA.vue";
import useBase64 from "./hook";
useBase64({ el: "#img" }).then((res) => {
  console.log(res.Baseurl);
});

//  调调用插件
import { ComponentInternalInstance, getCurrentInstance } from "vue";
const { appContext } = getCurrentInstance() as ComponentInternalInstance;
const showLoading = () => {
  appContext.config.globalProperties.$loading.show();
  setTimeout(() => {
    appContext.config.globalProperties.$loading.hide();
  }, 5000);
};
</script>

<style>
</style>